#! /bin/bash
#
# usage: allPairsTestScript algorithm lo hi
#
# Run unit test on series of random graphs, with a specified algorithm.
# The algorithm argument is one of edmondsKarp, floyd. The lo and hi arguments,
# specify the range of edge lengths. Negative edge lengths can be used
# for both algorithms.
#
algo="edmondsKarp"
if [ $# -ge 1 ] ; then
	algo=$1
fi;
lo="1"
if [ $# -ge 2 ] ; then
	lo=$2
fi;
hi="9"
if [ $# -ge 3 ] ; then
	hi=$3
fi;
echo "testing algorithm: " $algo $lo $hi

echo "testing 6 vertex graph"
randGraph wdigraph 6 18 $lo $hi 1 1 | testAllPairs $algo 

echo ""; echo "testing 10 vertex graph"
randGraph wdigraph 10 25 $lo $hi 2 1 | testAllPairs $algo 

echo ""; echo "testing 20 vertex graph"
randGraph wdigraph 20 75 $lo $hi 2 1 | testAllPairs $algo 
